package cn.yjr.fragment;



import org.json.JSONObject;

import com.nostra13.universalimageloader.core.ImageLoader;

import android.support.v4.app.Fragment;

/**
 * @author vector
 *
 */
public class FragmentFactory{
	public static Fragment getInstanceByIndex(int index) {  
	        Fragment fragment = null;  
	        switch (index) {  
	            case 1:  
	                fragment = new PersonalCenterFragment();  
	                break;  
	            case 2:  
	                fragment = new ChatRoomFragment();  
	                break;  
	            case 3:  
	                fragment = new PersonalCenterFragment();  
	                break;  
	            case 4:  
	                fragment = new PersonalCenterFragment();  
	                break;  
            	default:
            		break;
	        }  
	        return fragment;  
	    } 
	public static Fragment getInstanceByIndex(int index, Object info) {  
        Fragment fragment = null; 
        JSONObject data = (JSONObject) info;
        switch (index) {  
            case 5:
            	fragment = new BaseInfoFragment(data);
            	break;
            case 6:
            	fragment = new BroadFragment(data);
            	break;
            case 7:
            	fragment = new BaseInfoFragment(data);
            	break;
        	default:
        		fragment = new BaseInfoFragment(data);
        		break;
        }  
        return fragment;  
    }  
}
